﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GSLMS.Services.Interface;
using GSLMS.Entity;
using GSLMS.Entity.DTO;
using GSLMS.DAL;
namespace GSLMS.Services
{
	/// <summary>
	/// 此层为服务层，已经继承了父类BaseService,已经定义好方法请查看BaseService类；若需要自定义方法请在此层增加并在数据层及接口层定义相关的方法
	/// </summary>
	public partial class SAPP_AUDIT: BaseService<TB_APP_AUDIT>, IAPP_AUDIT
	{
		private static readonly GSLMS.DAL.Oracle.APP_AUDIT dal = new GSLMS.DAL.Oracle.APP_AUDIT();
		public override BaseDAL<TB_APP_AUDIT> DAL
		{
			get { return dal; }
		}

        /// <summary>
        /// 首席风控官审批
        /// </summary>
        /// <returns></returns>
        public int DirectorAudit(GSLMS.Entity.TB_APP_DIRECTORAUDIT model)
        {
            return dal.DirectorAudit(model);
        }

        /// <summary>
        /// 判断是否允许首席风控官撤回审批
        /// </summary>
        /// <param name="proID">立项申请记录ID</param>
        /// <returns></returns>
        public bool IsDirectorAuditRetract(long proID,long auditID)
        {
            return dal.IsDirectorAuditRetract(proID, auditID);
        }

        /// <summary>
        /// 提取首席风控官审批中要显示的项目经理和总经理审批的信息
        /// </summary>
        /// <param name="proID"></param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_AUDIT> GetDirectorAuditInfo(long proID)
        {
            return dal.GetDirectorAuditInfo(proID);
        }

        /// <summary>
        /// 提取审议审批中要显示的项目经理和总经理审批的信息
        /// </summary>
        /// <param name="proID"></param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_AUDIT> GetRiskAuditConAduAuditInfo(long proID)
        {
            return dal.GetRiskAuditConAduAuditInfo(proID);
        }

        /// <summary>
        /// 提取部门经理待审批信息
        /// </summary>
        /// <param name="actionBy">提取人</param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_SHOULDDOINFO> GetBMShouldDoList(string actionBy)
        {
            return dal.GetBMShouldDoList(actionBy);
        }

        /// <summary>
        /// 提取项目总经理待审批信息
        /// </summary>
        /// <param name="actionBy">提取人</param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_SHOULDDOINFO> GetGMShouldDoList(string actionBy)
        {
            return dal.GetGMShouldDoList(actionBy);
        }

        /// <summary>
        /// 立项申请项目经理审批
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ProInfoBMAudit(GSLMS.Entity.TB_APP_AUDIT model)
        {
            return dal.ProInfoBMAudit(model);
        }

        /// <summary>
        /// 转介申请审批
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool RefInfoAudit(GSLMS.Entity.TB_APP_REFREGINFO model)
        {
            return dal.RefInfoAudit(model);
        }

        /// <summary>
        /// 新增转介分配信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool RefInfoAss(GSLMS.Entity.TB_APP_REFREGINFO model)
        {
            return dal.RefInfoAss(model);
        }

        /// <summary>
        /// 提取首席风控官审批信息
        /// </summary>
        /// <param name="id">记录ID</param>
        /// <returns></returns>
        public GSLMS.Entity.TB_APP_DIRECTORAUDIT GetDirectorAuditByID(long id)
        {
            return dal.GetDirectorAuditByID(id);
        }

        /// <summary>
        /// 提取首席风控官待审批信息
        /// </summary>
        /// <param name="actionBy">提取人</param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_SHOULDDOINFO> GetRiskAuditShouldDoList(string actionBy)
        {
            return dal.GetRiskAuditShouldDoList(actionBy);
        }

        /// <summary>
        /// 分页提取首席风控官审批数据
        /// </summary>
        public List<GSLMS.Entity.TB_APP_DIRECTORAUDIT> GetDirectorAuditList(GSLMS.Entity.TB_APP_DIRECTORAUDIT searchParam)
        {
            return dal.GetDirectorAuditList(searchParam);
        }

        #region 总裁、董事长审批

        /// <summary>
        /// 提取总裁、董事长要显示的审批信息
        /// </summary>
        /// <param name="proID"></param>
        /// <returns></returns>
        public GSLMS.Entity.HighAuditInfo GetHighAuditInfo(long proID)
        {
            return dal.GetHighAuditInfo(proID);
        }
        
         /// <summary>
        /// 提取总裁、董事长待审批信息
        /// </summary>
        /// <param name="actionBy">提取人</param>
        /// <returns></returns>
        public List<GSLMS.Entity.TB_APP_SHOULDDOINFO> GetHighAuditShouldDoList(string actionBy)
        {
            return dal.GetHighAuditShouldDoList(actionBy);
        }

        /// <summary>
        /// 总裁、董事长审批(包括同意，拒绝，退回，撤回)
        /// </summary>
        /// <returns>返回1成功，-1不允许审批，0失败</returns>
        public int ToHighAudit(GSLMS.Entity.TB_APP_DIRECTORAUDIT model)
        {
            return dal.ToHighAudit(model);
        }

        /// <summary>
        /// 分页提取总裁、董事长审批数据
        /// </summary>
        public List<GSLMS.Entity.TB_APP_DIRECTORAUDIT> GetHighAuditList(GSLMS.Entity.TB_APP_DIRECTORAUDIT searchParam)
        {
            return dal.GetHighAuditList(searchParam);
        }

        /// <summary>
        /// 判断是否允许总裁、董事长撤回审批
        /// </summary>
        /// <param name="proID">立项申请记录ID</param>
        /// <returns></returns>
        public bool IsHighAuditRetract(long proID, long auditID)
        {
            return dal.IsHighAuditRetract(proID, auditID);
        }

        #endregion
	}
}
